﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Fluent
{
    public class Window : IDisposable
    {
        public static Window Next(Browser browser, bool closeAfterSwitch = false)
        {
            var driver = browser.GetDriver();

            string currentWindow = driver.CurrentWindowHandle;
            string nextWindow = driver.WindowHandles.Except(new List<string>() { currentWindow }).First();

            if (closeAfterSwitch)
            {
                driver.Close();
            }

            driver.SwitchTo().Window(nextWindow);

            return new Window();
        }

        private Window()
        {

        }

        public Window(string title)
        {

        }

        public Window(Uri url)
        {

        }

        public void Dispose()
        {

        }
    }
}
